package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;

import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;

/**
 * @author fofas
 *
 */
public class hero implements IVoicedCommandHandler
{
	private static  String[] _voicedCommands =
	{
		"hero"
	};
	
	@Override
	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String Target)
	{
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Dont Press Command On Olympiad Games.");
		}
		
		if(activeChar.isHero())
		{
			activeChar.sendMessage("You Are Already A Hero!.");
		}
		else if(command.equalsIgnoreCase("hero"))
		{
			if(activeChar.getInventory().getInventoryItemCount(57, 0) < 150000000)
			{
				activeChar.sendMessage("You do not have enough Adena! Need 150 000 000.");
			}
			else
			{
				activeChar.getInventory().reduceAdena("hero", 150000000, activeChar, null);
				activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16));
				activeChar.setIsHero(true);
				activeChar.sendMessage("You Have Hero For Restart!");
				activeChar.broadcastUserInfo();
			}
	}
		return true;
	}
    @Override
    public String[] getVoicedCommandList()
    {
	return _voicedCommands;
    }
   }